import { getToken } from "@/untils";
import { Navigate } from 'react-router-dom'


export function AuthToken({ children }) {
    if(getToken()) {
        return <>{children}</>
    } else {
        return <Navigate to={'/login'} replace />
    }
}